package main

import (
	"fmt"
	"time"
)

func main() {

	ch1 := make(chan string, 2)
	go writeOnly(ch1)
	go readOnly(ch1)

	time.Sleep(time.Second)
}

func writeOnly(ch chan<- string) {
	ch <- "帅哥"
}
func readOnly(ch <-chan string) {
	data := <-ch
	fmt.Println(data)
}
